/*
 * com.javable.cese -- Cell Electrophysiology Simulation Environment (CESE)
 *
 * Copyright (C) 1999 - 2005 Sergey Missan
 * 
 * Dalhousie Univ., Halifax, NS, Canada
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * General Public License for more details.
 *
 * You should have received a copy of the GNU General Public
 * License along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
 *
 * Different license can be applied to this file 
 * under specific agreement with the code author
 * 
 */

package com.javable.cese.templates;

/**
 * This is an abstract class for exporting data from the model to a specific
 * storage.
 * <p>
 * Data can be exported to the file(s) or to any other storage object(s).
 */
public abstract class AbstractDataExport extends Object {

    /**
     * Model from which data are exported
     * 
     * @see AbstractAPModel
     */
    protected AbstractAPModel model;

    /**
     * Returns the current model
     * 
     * @return current model
     */
    public AbstractAPModel getModel() {
        return model;
    }

    /**
     * Sets the current model
     * 
     * @param m current model
     */
    public void setModel(AbstractAPModel m) {
        this.model = m;
    }

    /**
     * Abstract method that is being invoked before the main time loop in the
     * model <code>simulate()</code> method.
     * <p>
     * For example, you can open data files here.
     * 
     * @see AbstractAPModel#simulate()
     */
    public abstract void prepareExport();

    /**
     * Abstract method that is being invoked in every main time loop iteration
     * in the model <code>simulate()</code> method.
     * <p>
     * For example, you can save data to data files here.
     * 
     * @see AbstractAPModel#simulate
     * @param count current counter in simulation loop
     */
    public abstract void doExport(int count);

    /**
     * Abstract method that is being invoked after the main time loop in the
     * model <code>simulate()</code> method.
     * <p>
     * For example, you can close data files here.
     * 
     * @see AbstractAPModel#simulate
     */
    public abstract void finishExport();
}